package com.example.papercut.service.impl;

import com.example.papercut.entity.TextureTemplate;
import com.example.papercut.mapper.TextureTemplateMapper;
import com.example.papercut.service.TextureTemplateService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class TextureTemplateServiceImpl implements TextureTemplateService {

    private final TextureTemplateMapper textureMapper;

    @Autowired
    public TextureTemplateServiceImpl(TextureTemplateMapper textureMapper) {
        this.textureMapper = textureMapper;
    }

    @Override
    public TextureTemplate getTextureDetails(Integer id) {
        return textureMapper.findTextureById(id);
    }

    @Override
    public List<TextureTemplate> getAllTextures(Integer categoryId) {
        // 业务逻辑：如果 categoryId 为空，则查询所有。
        return textureMapper.findAllTextures(categoryId);
    }
    
}